/*******************************************************************************************************
* Currently the questionnaire is set to start at '13' because I want to test question 13.
* You can set it to whatever you want for your testing purpose.
********************************************************************************************************/
$.Questionnaire.first('13');

//--------------------------------------------------------------------------------------------------------
$.Questions['13']={
		question_template_selector: '#normal_question', // in oppose to the "DO NOT ASK" questions
		question: 'What is the total length of time you have lived on the streets or shelters?',
		show_answers_selector: '.show_answer',
		
		answer_template_selector: '#numeric_answer',
		answer_units: ['years', 'months'],
		process_values: function(pageElement, nextQuestionButton){
				var values=[];
				// assuming the input elements have class="value" and data-unit="years", etc.
				$(pageElement).find('.value').each(function(valueElement){
						values[$(valueElement).attr('data-unit')]=parseInt($(valueElement).val());
					});
				$.Questionnaire.save({
						months_on_the_street_or_in_shelter: values['years']*12+values['months']
					});
				$.Questionnaire.next('14'); // if it's the last question, you can just $.Questionnaire.end();
			},
		next_question_selector: '.next_question',
	0:0}; // 0:0 added to make things simpler to move around above. Everything can have a , at the end now.

//--------------------------------------------------------------------------------------------------------
$.Questions['15']={
		question_template_selector: '#normal_question', // in oppose to the "DO NOT ASK" questions
		question: 'Where do you sleep most frequently?',
		show_answers_selector: '.show_answer',
		
		answer_template_selector: '#radio_other_answer',
		answer_choices: ['Shelter','Outside(street,camp,park)','Car/Van/RV', 'Someone else\'s place'],
		process_values: function(pageElement, nextQuestionButton){
				$.Questionnaire.save({
						sleeping_location: nextQuestionButton.attr('data-choice-value')
					});
				$.Questionnaire.next('16'); // if it's the last question, you can just $.Questionnaire.end();
			},
		next_question_selector: '.next_question',
	0:0}; // 0:0 added to make things simpler to move around above. Everything can have a , at the end now.


